<?php
	
	/**
	 * Verifies bootstrapper execution to ensure file
	 * necessities, and disabling direct access
	 */
	defined('ENGINE') or exit;

	/**
	 * Attemptive concurrent redirect script with or
	 * without headers being sent in PHP
	 */
	function redirect($location = NULL)
	{
		if($location != NULL)
		{
			if(!headers_sent())
			{
				header('Location: ' . $location . '');
				exit;
			}
			else
			{
				echo(
					'<script type="text/javascript">' . PHP_EOL . 
					'	window.location.href="' . $location . '";' . PHP_EOL . 
					'</script>' . PHP_EOL . 
					'<noscript>' . PHP_EOL . 
					'	<meta http-equiv="refresh" content="0;url=' . $location . '" />' . PHP_EOL . 
					'</noscript>' . PHP_EOL 
				);
			}
		}
		
		return;
	}
	
?>